{[include file="../../../../library/view/templates/header.tpl"]}
{[include file="../../../../library/view/templates/common.tpl"]}
<script src="{[$host]}/js/goods/goodsFormula.js" type="text/javascript"></script>
<script src="{[$host]}/js/common/categoryTag.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="{[$host]}theme/commonTheme/css/plugins/themes/jquery.ui.all.css" />

        <div id="BMainContents">
        <div class="BSpace10px">
        </div>
        <div id="BMainTitleH1">
            {[$goods_EC0005_H1]}
        </div>
             <div id="BError">{[include file="../../../../library/view/templates/tag/error.tpl"]}</div>
             <div class="BFence">
    <div class="BSpace10px"></div>

       <form id="goodsFormulaForm" name="goodsFormulaForm" method="post">
            <input type="hidden" id="hidaddEditFg" name="hidaddEditFg" value = "{[$strAddEditFg]}"/>
            <input type="hidden" id="hidFormulaNo" name="hidFormulaNo" value = "{[$FormulaNo]}"/>
            <input type="hidden" id="hidGoodsNo" name="hidGoodsNo" value = "{[$GoodsNo]}"/>
       </form>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <div class="BFenceTopLeft">
                        </div>
                        <div class="BFenceTopRight">
                        </div>
                    </td>
                </tr>
                <tr>
                  <td class="BFenceSideLine">
                        <div style="border:1px solid #CCC; padding:3px; float:left; width:350px;">
                        {[$goods_EC0005_Product]}:&nbsp;&nbsp;
                        <select id = "selGoodsTp">
                            <option value = "2" {[if $arrFormulaInfo.GOODS_TP == 2]}selected {[/if]}>半成品</option>
                            <option value = "3" {[if $arrFormulaInfo.GOODS_TP == 3]}selected {[/if]}>成品</option>
                        </select><br/>
                        {[$goods_EC0005_FormulaName]}:&nbsp;&nbsp;<input type="text" id = "txtFormulaName"  name = "txtFormulaName" value="{[$arrFormulaInfo.FORMULA_NAME]}"><br/>
                        {[$goods_EC0005_GoodsName]}:&nbsp;&nbsp;<input type="text" id = "txtProductName"  name = "txtProductName" value="{[$arrFormulaInfo.GOODS_NAME]}"><br/>
                        {[$goods_EC0005_GoodsCode]}:&nbsp;&nbsp;<input type="text" id = "txtProductCode"  name = "txtProductCode" value="{[$arrFormulaInfo.GOODS_CODE]}">
                                    <table class="BListTable" width="100%">
                                            <tr>
                                                <td width="51" class="BListTableHeader">
                                                    NO.
                                                </td>
                                                <td width="140" class="BListTableHeader">
                                                    {[$goods_EC0005_GoodsName]}
                                                </td>
                                                <td width="38" class="BListTableHeader">
                                                    {[$goods_EC0005_Num]}
                                                </td>
                                                <td width="60" class="BListTableHeader">
                                                    {[$goods_EC0005_Operation]}
                                                </td>
                                                <td width="59" class="BListTableHeader">
                                                    {[$goods_EC0005_Delete]}
                                                </td>
                                          </tr>
                                    </table>
                                        <ul id="Bdragtable">
                                            {[foreach from = $arrFormulaItemInfo key = k item = msg]}
                                            <li id="Bdragtable{[$msg.GOODS_NO]}" class="ui-state-default">
                                              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="BNoMarginTable">
                                                <tr>
                                                  <td width="51" align="right"><span id="liNo">{[$k+1]}</span></td>
                                                  <td width="140"><div class="Ctxtparagraph" >{[$msg.GOODS_NAME]}</div></td>
                                                  <td width="38"><input type ="text" id = "txtNum" name = "txtNum" size = "1" value = "{[$msg.NUM]}"/></td>
                                                  <td width="60">
                                                        <img src="{[$host]}theme/commonTheme/img/ec-icon_up3.gif" onclick="goods_up('Bdragtable{[$msg.GOODS_NO]}')"/>
                                                        <img src="{[$host]}theme/commonTheme/img/ec-icon_down3.gif" onclick="goods_down('Bdragtable{[$msg.GOODS_NO]}')"/>
                                                  </td>
                                                  <td width="35"><img src="{[$host]}theme/commonTheme/img/ec-shop_icon5.gif" onclick="goods_deleteGoods('Bdragtable{[$msg.GOODS_NO]}')" /></td>
                                                  <td width="24" class="BgoodsLinksright"></td>
                                                </tr>
                                              </table>
                                              <input type="hidden" id="hidGoodsFormulaNo{[$msg.GOODS_NO]}"  name="hidGoodsFormulaNo" value="{[$msg.GOODS_NO]}" />
                                              <input type="hidden" id="hidGoodsFormulaName{[$msg.GOODS_NO]}"  name="hidGoodsFormulaName" value="{[$msg.GOODS_NAME]}" />
                                            </li>
                                             {[/foreach]}
                                        </ul>
                        </div>
                        <div class="BClickmoveExplanation">{[$titleH3Lable]}</div>
                        <div style="border:1px solid #CCC; padding:3px; float:right; width:520px;">
                                        <div align="left">
                                          <div class="BLittleTitle">{[$goods_EC0005_Title2]}</div>
                                        </div>
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="BGrayLineTable">
                                            
                                            <tr>
                                    <td width="20%" class="BListLabel">
                                        {[$goods_EC0005_GoodsCode]}
                                    </td>
                                    <td>
                                        <input type="text" id="txtGoodsCode" name="txtGoodsCode" size="30" value="{[$arrCondition.GoodsCode]}"/>
                                    </td>
                                    <td rowspan="10">
                                        <div class="BTextAlignCenter">
                                            <input type="button" id="EC0001OT01" name="EC0001OT01"
                                             value="{[$goods_EC0005_SearCondition]}" onclick="goods_dataSearch()" class="BGrayBtn" />
                                             <div class="BSpace10px"></div>
                                            <input type="button" id="EC0001OT01" name="EC0001OT02"
                                             value="{[$goods_EC0005_Clear]}" class="BGrayBtn" onclick="goods_reset()" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="20%" class="BListLabel">
                                        {[$goods_EC0005_GoodsName]}
                                    </td>
                                    <td>
                                        <input type="text" id="txtGoodsName" name="txtGoodsName" size="30" maxlength="128" value="{[$arrCondition.GoodsName]}"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="20%" class="BListLabel">
                                        {[$goods_EC0005_SalesPrice]}
                                    </td>
                                    <td>
                                        <input type="text" id="txtPriceFrom" name="txtPriceFrom" size="20"
                                          value="{[$arrCondition.PriceFrom]}" class="BTextAlignRight" />
                                        &nbsp;{[$goods_EC0005_Yen]}&nbsp;{[$goods_EC0005_Link]}&nbsp;
                                        <input type="text" id="txtPriceTo" name="txtPriceTo" size="20"
                                          value="{[$arrCondition.PriceTo]}" class="BTextAlignRight" />
                                        &nbsp;{[$goods_EC0005_Yen]}
                                    </td>
                                </tr>
                                <tr>
                                    <td class="BListLabel">
                                        {[$goods_EC0005_Class]}
                                    </td>
                                    <td>
                                        {[include file="../../../common/views/templates/categoryTag.tpl"]}
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td class="BListLabel">
                                        {[$goods_EC0005_InNum]}
                                    </td>
                                    <td>
                                        <input type="radio" id="rdoNumAll" name="rdoNum" {[if $strNumFlg == "0" || $strNumFlg == ""]} checked {[/if]} onclick="goods_setTextType('0')"/>&nbsp;
                                        <label for="rdoNumAll">{[$goods_EC0005_GetAll]}</label>&nbsp;&nbsp;
                                        <input type="radio" id="rdoNumLeft" name="rdoNum" {[if $strNumFlg == "1"]} checked {[/if]} onclick="goods_setTextType('1')"/>&nbsp;
                                        <label for="rdoNumLeft">{[$goods_EC0005_GetLeft]}</label>&nbsp;&nbsp;
                                        <input type="radio" id="rdoNumStock" name="rdoNum" {[if $strNumFlg == "2"]} checked {[/if]} onclick="goods_setTextType('2')"/>&nbsp;
                                        <label for="rdoNumStock">{[$goods_EC0005_GetExcut]}</label>&nbsp;&nbsp;
                                        <input type="radio" id="rdoNumDefined" name="rdoNum" {[if $strNumFlg == "3"]} checked {[/if]} onclick="goods_setTextType('3')"/>&nbsp;
                                        <label for="rdoNumDefined">{[$goods_EC0005_GetSet]}</label>
                                        <input type="text" id="txtNumFrom" name="txtNumFrom" size="8" class="BTextAlignRight" value="{[$arrCondition.StockNumFrom]}"{[if $strNumFlg != "3"]} disabled {[/if]}/>
                                        &nbsp;{[$goods_EC0005_Link]}&nbsp;
                                        <input type="text" id="txtNumTo" name="txtNumTo" size="8" class="BTextAlignRight"  value="{[$arrCondition.StockNumTo]}" {[if $strNumFlg != "3"]} disabled {[/if]}/>
                                    </td>
                                </tr>
                                        </table>
                                        <!--<div class="BSpace10px">
                                        </div>-->
                                       <div class="BSpace20px"></div> 
                                       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="BNoMarginTable">
                                           <tr>
                                                <td  valign="bottom">{[$goodsLable1]}<br/>{[$goodsLable2]}</td>
                                                <td  valign="bottom">
                                                <div align="right" >
                                                    <div id="orderDetail">{[include file="../../../../library/view/templates/tag/order.tpl"]}</div>
                                                </div>
                                                <div align="right" class="BPasingArea" id="pageHead">
                                                    {[include file="../../../../library/view/templates/tag/pager.tpl"]}
                                                </div></td>
                                           </tr>
                                       </table>
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="BGrayLineTable">
                                            <tr align="left" id="trHeader">
                                                <td>
                                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="BListTable">
                                                        <tr>
                                                          <td class="BListTableHeader" style="width: 10%">
                                                                No.
                                                            </td>
                                                            <td class="BListLabel" style="width: 20%" id="A.SUPPLIER_ID" onclick="initOrder('orderHead');">
                                                                {[$goods_EC0005_GoodsCode]}
                                                                {[include file="../../../../library/view/templates/tag/orderView.tpl"]}
                                                            </td>
                                                            <td class="BListLabel" style="width: 30%" id="A.SUPPLIER_NAME" onclick="initOrder('orderHead');">
                                                                {[$goods_EC0005_GoodsName]}
                                                                {[include file="../../../../library/view/templates/tag/orderView.tpl"]}
                                                            </td>
                                                            <td class="BListLabel" style="width: 40%" id="A.PROV_CODE" onclick="initOrder('orderHead');">
                                                                {[$goods_EC0005_InNum]}
                                                                {[include file="../../../../library/view/templates/tag/orderView.tpl"]}
                                                            </td>
                                                        </tr>
                                                  </table>
                                                   <ul id="goodsList">
                                                        {[foreach from = $arrGoods item = msg key = i]}
                                                                <li id="goodsList{[$msg.GOODS_NO]}" flag="{[$i]}">
                                                                    <table width="100%" class="BListTable">
                                                                    {[if $msg.disableFlag == 1]}
                                                                    <tr id="{[$i]}" flag="1" class="BClickmoveGrayoutOdd" >
                                                                     {[else]}
                                                                    <tr id="{[$i]}" class = "BClickmoveOdd">
                                                                     {[/if]}
                                                                           <td width="10%" align="left" class="title1">
                                                                           <img id="imgDelete" src="{[$host]}theme/commonTheme/img/ec-shop_icon1.gif"/>{[$msg.NO]}
                                                                           </td>
                                                                           <td width="20%" align="left" class="title2 word-break-all">
                                                                               <a href="{[$host]}supplier/supplierView/index/SupplierNo/{[$msg.SUPPLIER_NO]}">{[$msg.GOODS_CODE]}</a>
                                                                           </td>
                                                                           <td width="30%" align="left" class="title1">
                                                                               {[$msg.GOODS_NAME]}
                                                                           </td>
                                                                           <td width="40%" align="left" class="title1">
                                                                               {[$msg.STOCK_NUM]}
                                                                           </td>
                                                                       </tr>
                                                                   </table>
                                                                       <input type="hidden" id="hidGoodsNo"  name="hidGoodsNo" value="{[$msg.GOODS_NO]}" />
                                                                       <input type="hidden" id="hidGoodsName"  name="hidGoodsName" value="{[$msg.GOODS_NAME]}" />
                                                                </li>
                                                               {[/foreach]}
                                                </ul>
                                            </td>
                                            </tr>
                                        </table>
                                         <div align="right" class="BPasingArea" id="pageFoot">
                                            {[include file="../../../../library/view/templates/tag/pager.tpl"]}
                                         </div>
                             </div>
                      </td>
                    </tr>
                    
                    <tr>
                        <td>
                        <div class="BFenceBottomLeft">                        </div>
                        <div class="BFenceBottomRight">                        </div>
                        </td>
                    </tr>
                </table>
            <div class="BSpace20px">
            </div>
            <div class="BTextAlignCenter">
                <input type="submit" id="EC0013MV01" name="EC0013MV01" class="BGrayBtnMiddle" value="{[$goods_EC0005_Set]}" onclick="goods_FormulaSaveClick('{[$strAddEditFg]}')" />
                <input type="submit" id="EC0013MV01" name="EC0013MV02" class="BGrayBtnMiddle" value="{[$goods_EC0005_Back]}" onclick="goods_back()" />
            </div><div class="BSpace20px"></div>
        </div>
        </div>
{[include file="../../../../library/view/templates/footer.tpl"]}